package com.lee.boot.head.first.demo.redis.message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @description 使用redis发送消息
 * @author edz
 */
@Component
public class RedisMessageProducer {

    @Autowired
    RedisTemplate redisTemplate;

    public void sendMessage(String message){
        redisTemplate.convertAndSend("topic1",message);

    }
}
